import {createRouter, createWebHistory,} from 'vue-router'

export const routes = [
    {
        name: 'home',
        path: '/',
        redirect: '/home',
        children: [
            {
                name: 'home',
                path: '/home',
                component: () => import('../pages/home/index.vue')
            },
            {
                name: 'canvas',
                path: '/canvas',
                component: () => import('../pages/canvas/index.vue')
            },
        ]
    }
]
const router = createRouter({
    scrollBehavior: () => ({left: 0, top: 0}),
    history: createWebHistory(),
    routes,
})
router.beforeEach((to, from, next) => {
    next()
    console.log(to, from, next)
})
export default router